home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / c / cenvid9.zip / DISKFREE.BAT < prev    next >
DOS Batch File  |  1994-03-04  |  1KB  |  29 lines

  1. @echo OFF
  2. REM ********************************************************************
  3. REM *** DiskFree.bat - Display how much disk space is available on a ***
  4. REM *** ver.1          drive, and set the DISK_FREE environment      ***
  5. REM ***                variable to that amount.  This batch file is  ***
  6. REM ***                very specific to COMMAND.COM under MSDOS      ***
  7. REM ***                version 5.0 and is not guaranteed to give     ***
  8. REM ***                correct results in any other circumstance.    ***
  9. REM ***                                                              ***
  10. REM *** Here's another method for free disk space for drive C:       ***
  11. REM *** CEnvi reg.dl=3;reg.ah=0x36;interrupt(0x21,reg);              ***
  12. REM ***       DISKFREE=reg.cx * reg.ax * reg.bx;                     ***
  13. REM ********************************************************************
  14.  
  15. if "%1" == "" GOTO SHOW_HOW
  16. if not "%2"=="" GOTO SHOW_HOW
  17. dir %1:\NUL | find "bytes free" | cenvi DISK_FREE = atol(gets()) / 1024
  18. ECHO DRIVE %1 HAS %DISK_FREE% K-BYTES FREE
  19. GOTO FINI
  20.  
  21. :SHOW_HOW
  22. ECHO DiskFree.bat - Show how much disk space is available on a drive, in kilobytes,
  23. ECHO                and set DISK_FREE environment variable to that size
  24. ECHO USAGE: DiskFree DriveLetter
  25. ECHO Example: DiskFree C
  26. GOTO FINI
  27.  
  28. :FINI
  29.